import yaml
import os
from django.conf import settings


# config_file_path=os.path.join(settings.STATIC_ROOT,'config.yaml')
# oss_file_path=os.path.join(settings.STATIC_ROOT,'oss.yaml')
config_file_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),'config.yaml')
oss_file_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),'oss.yaml')
# os.path.dirname(os.path.abspath(__file__))
class Config:
    def __init__(self):

        config_ = yaml.load(open(config_file_path, 'r'), Loader=yaml.Loader)
        self.local_path = config_['local_path']
        self.rate = config_['rate']

        oss_config_ = yaml.load(open(oss_file_path, 'r'), Loader=yaml.Loader)
        self.username = oss_config_['username']
        self.endpoint = oss_config_['endpoint']
        self.accesskey = oss_config_['accesskey']
        self.secret = oss_config_['secret']

    def __str__(self):
        return self.local_path


# if __name__ == '__main__':
#     conf = Config()
#     print(conf.__str__())
